#pragma once

#include "helper/SAdapterBase.h"

#include "Goods.h"
class CodeListAdapter : public  SOUI::SMcAdapterBase {
  public:
    CodeListAdapter();
    ~CodeListAdapter();
    
  public:
    virtual int getCount();
    virtual void getView(int position, SOUI::SWindow *pItem, pugi::xml_node xmlTemplate);
    
    virtual SOUI::SStringW GetColumnName(int iCol) const;
    
    std::vector<SOUI::SStringW> GetColumnNames();
    void  setColumnNames(const std::vector<SOUI::SStringW> &names);
    
  private:
    void updateText(SOUI::SWindow *pItem, const SOUI::SStringW &ctrlName, GoodsPtr pGoods, int fid);
    
  private:
    std::vector<SOUI::SStringW>         m_colNames;
  public:
    std::vector< GoodsPtr>              m_goodsList;
};